/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * DiagnosticoYTriageInternacionPresentacion.java
 *
 * Created on 08/11/2010, 14:34:44
 */

package presentacion.enfermedad_y_diagnostico;

import com.toedter.calendar.IDateEditor;
import hibernate.objeto.DiagnosticoYTriageInternacion;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.Calendar;
import java.util.Date;
import javax.swing.JSpinner;
import javax.swing.JSpinner.DefaultEditor;
import javax.swing.SpinnerDateModel;
import logica.CapaLogica;
import logica.DiagnosticoYTriageInternacionLogica;
import logica.TriageLogica;
import logica.validacion.CapaValidacion;
import presentacion.CapaPresentacion;
import presentacion.GestionPacientePresentacion;
import presentacion.acceso.RestriccionAcceso;
import presentacion.utilidad.maquetado.Fuente;
import presentacion.utilidad.maquetado.Icono;
import presentacion.utilidad.maquetado.InformeError;
import presentacion.evolucion.DatosSignosVitales;
import presentacion.utilidad.BarMenu;
import presentacion.utilidad.MensajePresentacion;

/**
 *
 * @author Gonzalo
 */
public class DiagnosticoYTriageInternacionPresentacion extends javax.swing.JDialog {

    /** Creates new form EnfermedadYDiagnosticoAmbulatorioPresentacion */
    public DiagnosticoYTriageInternacionPresentacion(java.awt.Frame parent, boolean modal,
            DiagnosticoYTriageInternacion unDiagnosticoYTriageInternacion) {
        super(parent, modal);

        diagnosticoYTriageInternacion = unDiagnosticoYTriageInternacion;

        initComponents();
        personalizarGUI();
        setearEventosQueCapturanTeclaEnterYEscape();
        setSize(CapaPresentacion.getTamañoMaximoJDialog());
        setLocationRelativeTo(null);
        
    }

    /**
     * Setea datos de la ventana.
     *
     */
    private void personalizarGUI() {
        //Crea la barra de menu
        this.setJMenuBar(BarMenu.createMenuBarDiagnosticoYTriageInternacion(this));

        panelSignosVitales.add(new DatosSignosVitales());
        panelSignosVitales.revalidate();
        panelSignosVitales.repaint();

        if (CapaPresentacion.modoCarga) {
            modoCarga();
        } else if (CapaPresentacion.modoModificacion) {
            modoModificacion();
        } else if (CapaPresentacion.modoVisualizacion) {
            modoVisualizacion();
        }
    }

    /**
     * Setea la ventana en modo carga.
     *
     */
    private void modoCarga() {
        horaEnfermedadYDiagnostico.getModel().setValue(new Date());
        fechaEnfermedadYDiagnostico.setDate(new Date());

        botonEpicrisis.setVisible(false);
        botonAgregarEvolucionEnfermeria.setVisible(false);
    }

    /**
     * Setea la ventana en modo modificación.
     *
     */
    private void modoModificacion() {
        exhibirDatosEnPantalla();

        horaEnfermedadYDiagnostico.getModel().setValue(new Date());
        fechaEnfermedadYDiagnostico.setDate(new Date());
    }

    /**
     * Setea la ventana en modo visualización.
     *
     */
    private void modoVisualizacion() {
        exhibirDatosEnPantalla();
        setearEstadoCampos(true);
        botonCancelar.requestFocus();
        CapaPresentacion.personalizarBotonesEnVisualizacion(textoDescriptivoVentana,
                botonAceptar, botonCancelar);
    }

    /**
     * Permite visualizar los detalles del diagnóstico y triage.
     *
     */
    private void exhibirDatosEnPantalla() {
        CapaPresentacion.setearLabelEstado(
                diagnosticoYTriageInternacion, textoEstadoEntidad);

        String horaEnString = diagnosticoYTriageInternacion.
                getHoraDiagnosticoYTriageInternacion();
        horaEnfermedadYDiagnostico.getModel().setValue(new Date(0, 0, 0,
                CapaLogica.separarHoras(horaEnString),
                CapaLogica.separarMinutos(horaEnString),
                CapaLogica.separarSegundos(horaEnString)));
        fechaEnfermedadYDiagnostico.setDate(diagnosticoYTriageInternacion.
                getFechaDiagnosticoYTriageInternacion());
        diagnostico.setText(
                diagnosticoYTriageInternacion.
                getDiagnosticoDiagnosticoYTriageInternacion());
        diagnostico.setCaretPosition(0);
        informacionComplementariaDiagnostico.setText(
                diagnosticoYTriageInternacion.
                getDescripcionDiagnosticoDiagnosticoYTriageInternacion());
        informacionComplementariaDiagnostico.setCaretPosition(0);

        if (diagnosticoYTriageInternacion.getTriage() != null) {

            ((DatosSignosVitales) panelSignosVitales.getComponent(0)).
                    exhibirDatosSignosVitales(
                    diagnosticoYTriageInternacion.getTriage());

            tiempoDolorToracico.setValue(diagnosticoYTriageInternacion.getTriage().
                    getTiempoDolorToracicoTriage());

            if (diagnosticoYTriageInternacion.getTriage().getInconcienteTriage().
                    equalsIgnoreCase("si")) {
                    siInconciente.setSelected(true);
            } else if (diagnosticoYTriageInternacion.getTriage().getInconcienteTriage().
                    equalsIgnoreCase("no")) {
                    noInconciente.setSelected(true);
            }

            if (diagnosticoYTriageInternacion.getTriage().getExcitadoTriage().
                    equalsIgnoreCase("si")) {
                    siExcitado.setSelected(true);
            } else if (diagnosticoYTriageInternacion.getTriage().getExcitadoTriage().
                    equalsIgnoreCase("no")) {
                    noExcitado.setSelected(true);
            }

            if (diagnosticoYTriageInternacion.getTriage().getSangradoActivoTriage().
                    equalsIgnoreCase("si")) {
                    siSangradoActivo.setSelected(true);
            } else if (diagnosticoYTriageInternacion.getTriage().getSangradoActivoTriage().
                    equalsIgnoreCase("no")) {
                    noSangradoActivo.setSelected(true);
            }

            if (diagnosticoYTriageInternacion.getTriage().getTomaSintromTriage().
                    equalsIgnoreCase("si")) {
                    siTomaSintrom.setSelected(true);
            } else if (diagnosticoYTriageInternacion.getTriage().getTomaSintromTriage().
                    equalsIgnoreCase("no")) {
                    noTomaSintrom.setSelected(true);
            }

            if (diagnosticoYTriageInternacion.getTriage().getCrisisConvulsivaTriage().
                    equalsIgnoreCase("si")) {
                    siCrisisConvulsiva.setSelected(true);
            } else if (diagnosticoYTriageInternacion.getTriage().getCrisisConvulsivaTriage().
                    equalsIgnoreCase("no")) {
                    noCrisisConvulsiva.setSelected(true);
            }

            if (diagnosticoYTriageInternacion.getTriage().getTecTriage().
                    equalsIgnoreCase("si")) {
                    siTEC.setSelected(true);
            } else if (diagnosticoYTriageInternacion.getTriage().getTecTriage().
                    equalsIgnoreCase("no")) {
                    noTEC.setSelected(true);
            }

            if (diagnosticoYTriageInternacion.getTriage().getCianosisTriage().
                    equalsIgnoreCase("si")) {
                    siCianosis.setSelected(true);
            } else if (diagnosticoYTriageInternacion.getTriage().getCianosisTriage().
                    equalsIgnoreCase("no")) {
                    noCianosis.setSelected(true);
            }

            if (diagnosticoYTriageInternacion.getTriage().getRellenoCapilarTriage().
                    equalsIgnoreCase("si")) {
                    siRellenoCapilar.setSelected(true);
            } else if (diagnosticoYTriageInternacion.getTriage().getRellenoCapilarTriage().
                    equalsIgnoreCase("no")) {
                    noRellenoCapilar.setSelected(true);
            }
        }
    }

    /**
     * Setea el estado de los campos.
     *
     * @param estado El estado de los campos
     */
    private void setearEstadoCampos(boolean estado) {
        horaEnfermedadYDiagnostico.setEnabled(estado);
        fechaEnfermedadYDiagnostico.setEnabled(estado);
        diagnostico.setEnabled(estado);
        informacionComplementariaDiagnostico.setEnabled(estado);

        ((DatosSignosVitales) panelSignosVitales.getComponent(0)).
                setearEstadoCampos(estado);

        tiempoDolorToracico.setEnabled(estado);

        siInconciente.setEnabled(estado);
        noInconciente.setEnabled(estado);

        siExcitado.setEnabled(estado);
        noExcitado.setEnabled(estado);

        siSangradoActivo.setEnabled(estado);
        noSangradoActivo.setEnabled(estado);

        siTomaSintrom.setEnabled(estado);
        noTomaSintrom.setEnabled(estado);

        siCrisisConvulsiva.setEnabled(estado);
        noCrisisConvulsiva.setEnabled(estado);

        siTEC.setEnabled(estado);
        noTEC.setEnabled(estado);

        siCianosis.setEnabled(estado);
        noCianosis.setEnabled(estado);

        siRellenoCapilar.setEnabled(estado);
        noRellenoCapilar.setEnabled(estado);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        textoDescriptivoVentana = new javax.swing.JLabel();
        panelDiagnostico = new javax.swing.JPanel();
        textoHoraYFechaEnfermedadYDiagnostico = new javax.swing.JLabel();
        SpinnerDateModel spinerModel = new SpinnerDateModel(new Date(0, 0, 0, Calendar.HOUR_OF_DAY, 0, 0), null, null, Calendar.HOUR_OF_DAY);
        horaEnfermedadYDiagnostico = new javax.swing.JSpinner(spinerModel);
        fechaEnfermedadYDiagnostico = new com.toedter.calendar.JDateChooser();
        textoDiagnostico = new javax.swing.JLabel();
        diagnosticoScrollPanel = new javax.swing.JScrollPane();
        diagnostico = new javax.swing.JTextArea();
        textoInformacionComplementariaDiagnostico = new javax.swing.JLabel();
        informacionComplementariaDiagnosticoScrollPanel = new javax.swing.JScrollPane();
        informacionComplementariaDiagnostico = new javax.swing.JTextArea();
        panelTriageScrollPanel = new javax.swing.JScrollPane();
        panelTriage = new javax.swing.JPanel();
        panelSignosVitales = new javax.swing.JPanel();
        separador1 = new javax.swing.JSeparator();
        panelPreguntas = new javax.swing.JPanel();
        textoTiempoDolorToracico = new javax.swing.JLabel();
        tiempoDolorToracico = new javax.swing.JSpinner();
        textoInconciente = new javax.swing.JLabel();
        siInconciente = new javax.swing.JRadioButton();
        noInconciente = new javax.swing.JRadioButton();
        textoExcitado = new javax.swing.JLabel();
        siExcitado = new javax.swing.JRadioButton();
        noExcitado = new javax.swing.JRadioButton();
        textoSangradoActivo = new javax.swing.JLabel();
        siSangradoActivo = new javax.swing.JRadioButton();
        noSangradoActivo = new javax.swing.JRadioButton();
        textoTomaSintrom = new javax.swing.JLabel();
        siTomaSintrom = new javax.swing.JRadioButton();
        noTomaSintrom = new javax.swing.JRadioButton();
        textoCrisisConvulsiva = new javax.swing.JLabel();
        siCrisisConvulsiva = new javax.swing.JRadioButton();
        noCrisisConvulsiva = new javax.swing.JRadioButton();
        textoTEC = new javax.swing.JLabel();
        siTEC = new javax.swing.JRadioButton();
        noTEC = new javax.swing.JRadioButton();
        textoCianosis = new javax.swing.JLabel();
        siCianosis = new javax.swing.JRadioButton();
        noCianosis = new javax.swing.JRadioButton();
        textoRellenoCapilar = new javax.swing.JLabel();
        siRellenoCapilar = new javax.swing.JRadioButton();
        noRellenoCapilar = new javax.swing.JRadioButton();
        botonCancelar = new javax.swing.JButton();
        botonAceptar = new javax.swing.JButton();
        textoEstadoEntidad = new javax.swing.JLabel();
        botonEpicrisis = new javax.swing.JButton();
        botonAgregarEvolucionEnfermeria = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Diagnóstico y TRIAGE - Internación");
        setMinimumSize(new java.awt.Dimension(816, 728));
        setResizable(false);

        textoDescriptivoVentana.setFont(Fuente.FUENTE_TITULO_2);
        textoDescriptivoVentana.setForeground(Fuente.COLOR_NORMAL);
        textoDescriptivoVentana.setText("Ingrese la información de la internación");
        textoDescriptivoVentana.setPreferredSize(new java.awt.Dimension(612, 20));

        panelDiagnostico.setMinimumSize(new java.awt.Dimension(0, 0));

        textoHoraYFechaEnfermedadYDiagnostico.setFont(Fuente.FUENTE_LABEL);
        textoHoraYFechaEnfermedadYDiagnostico.setForeground(Fuente.COLOR_NORMAL);
        textoHoraYFechaEnfermedadYDiagnostico.setText("Hora y fecha");
        textoHoraYFechaEnfermedadYDiagnostico.setPreferredSize(new java.awt.Dimension(135, 20));

        fechaEnfermedadYDiagnostico.setToolTipText("");
        fechaEnfermedadYDiagnostico.setDate(new Date());
        fechaEnfermedadYDiagnostico.setMaxSelectableDate(new Date());
        fechaEnfermedadYDiagnostico.setMinSelectableDate(new java.util.Date(-2208985673000L));
        fechaEnfermedadYDiagnostico.setPreferredSize(new java.awt.Dimension(144, 20));

        textoDiagnostico.setFont(Fuente.FUENTE_LABEL);
        textoDiagnostico.setForeground(Fuente.COLOR_NORMAL);
        textoDiagnostico.setText("Diagnóstico");
        textoDiagnostico.setPreferredSize(new java.awt.Dimension(230, 20));

        diagnosticoScrollPanel.setPreferredSize(new java.awt.Dimension(405, 242));

        diagnostico.setColumns(2);
        diagnostico.setFont(Fuente.FUENTE_TEXTFIELD);
        diagnostico.setForeground(Fuente.COLOR_NORMAL);
        diagnostico.setLineWrap(true);
        diagnostico.setRows(2);
        diagnostico.setWrapStyleWord(true);
        diagnosticoScrollPanel.setViewportView(diagnostico);

        textoInformacionComplementariaDiagnostico.setFont(Fuente.FUENTE_LABEL);
        textoInformacionComplementariaDiagnostico.setForeground(Fuente.COLOR_NORMAL);
        textoInformacionComplementariaDiagnostico.setText("Información complementaria del diagnóstico");
        textoInformacionComplementariaDiagnostico.setPreferredSize(new java.awt.Dimension(230, 20));

        informacionComplementariaDiagnosticoScrollPanel.setPreferredSize(new java.awt.Dimension(405, 242));

        informacionComplementariaDiagnostico.setColumns(2);
        informacionComplementariaDiagnostico.setFont(Fuente.FUENTE_TEXTFIELD);
        informacionComplementariaDiagnostico.setForeground(Fuente.COLOR_NORMAL);
        informacionComplementariaDiagnostico.setLineWrap(true);
        informacionComplementariaDiagnostico.setRows(2);
        informacionComplementariaDiagnostico.setWrapStyleWord(true);
        informacionComplementariaDiagnosticoScrollPanel.setViewportView(informacionComplementariaDiagnostico);

        panelTriageScrollPanel.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        panelTriageScrollPanel.setPreferredSize(new java.awt.Dimension(337, 527));

        panelTriage.setPreferredSize(new java.awt.Dimension(323, 658));

        panelSignosVitales.setPreferredSize(new java.awt.Dimension(297, 311));
        panelSignosVitales.setLayout(new javax.swing.BoxLayout(panelSignosVitales, javax.swing.BoxLayout.LINE_AXIS));

        separador1.setPreferredSize(new java.awt.Dimension(291, 2));

        panelPreguntas.setBorder(javax.swing.BorderFactory.createTitledBorder("Preguntas"));
        panelPreguntas.setPreferredSize(new java.awt.Dimension(297, 304));

        textoTiempoDolorToracico.setFont(Fuente.FUENTE_LABEL);
        textoTiempoDolorToracico.setForeground(Fuente.COLOR_NORMAL);
        textoTiempoDolorToracico.setText("Tiempo de dolor toracico (minutos)");
        textoTiempoDolorToracico.setPreferredSize(new java.awt.Dimension(179, 20));

        tiempoDolorToracico.setFont(Fuente.FUENTE_TEXTFIELD);
        tiempoDolorToracico.setPreferredSize(new java.awt.Dimension(70, 20));

        textoInconciente.setFont(Fuente.FUENTE_LABEL);
        textoInconciente.setForeground(Fuente.COLOR_NORMAL);
        textoInconciente.setText("Inconciente");
        textoInconciente.setPreferredSize(new java.awt.Dimension(179, 20));

        siInconciente.setFont(Fuente.FUENTE_RADIOBUTTON);
        siInconciente.setForeground(Fuente.COLOR_NORMAL);
        siInconciente.setText("si");
        siInconciente.setPreferredSize(new java.awt.Dimension(42, 14));
        siInconciente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                siInconcienteActionPerformed(evt);
            }
        });

        noInconciente.setFont(Fuente.FUENTE_RADIOBUTTON);
        noInconciente.setForeground(Fuente.COLOR_NORMAL);
        noInconciente.setText("no");
        noInconciente.setPreferredSize(new java.awt.Dimension(42, 14));
        noInconciente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                noInconcienteActionPerformed(evt);
            }
        });

        textoExcitado.setFont(Fuente.FUENTE_LABEL);
        textoExcitado.setForeground(Fuente.COLOR_NORMAL);
        textoExcitado.setText("Excitado");
        textoExcitado.setPreferredSize(new java.awt.Dimension(179, 20));

        siExcitado.setFont(Fuente.FUENTE_RADIOBUTTON);
        siExcitado.setForeground(Fuente.COLOR_NORMAL);
        siExcitado.setText("si");
        siExcitado.setPreferredSize(new java.awt.Dimension(42, 14));
        siExcitado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                siExcitadoActionPerformed(evt);
            }
        });

        noExcitado.setFont(Fuente.FUENTE_RADIOBUTTON);
        noExcitado.setForeground(Fuente.COLOR_NORMAL);
        noExcitado.setText("no");
        noExcitado.setPreferredSize(new java.awt.Dimension(42, 14));
        noExcitado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                noExcitadoActionPerformed(evt);
            }
        });

        textoSangradoActivo.setFont(Fuente.FUENTE_LABEL);
        textoSangradoActivo.setForeground(Fuente.COLOR_NORMAL);
        textoSangradoActivo.setText("Sangrado activo");
        textoSangradoActivo.setPreferredSize(new java.awt.Dimension(179, 20));

        siSangradoActivo.setFont(Fuente.FUENTE_RADIOBUTTON);
        siSangradoActivo.setForeground(Fuente.COLOR_NORMAL);
        siSangradoActivo.setText("si");
        siSangradoActivo.setPreferredSize(new java.awt.Dimension(42, 14));
        siSangradoActivo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                siSangradoActivoActionPerformed(evt);
            }
        });

        noSangradoActivo.setFont(Fuente.FUENTE_RADIOBUTTON);
        noSangradoActivo.setForeground(Fuente.COLOR_NORMAL);
        noSangradoActivo.setText("no");
        noSangradoActivo.setPreferredSize(new java.awt.Dimension(42, 14));
        noSangradoActivo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                noSangradoActivoActionPerformed(evt);
            }
        });

        textoTomaSintrom.setFont(Fuente.FUENTE_LABEL);
        textoTomaSintrom.setForeground(Fuente.COLOR_NORMAL);
        textoTomaSintrom.setText("Toma Sintrom");
        textoTomaSintrom.setPreferredSize(new java.awt.Dimension(179, 20));

        siTomaSintrom.setFont(Fuente.FUENTE_RADIOBUTTON);
        siTomaSintrom.setForeground(Fuente.COLOR_NORMAL);
        siTomaSintrom.setText("si");
        siTomaSintrom.setPreferredSize(new java.awt.Dimension(42, 14));
        siTomaSintrom.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                siTomaSintromActionPerformed(evt);
            }
        });

        noTomaSintrom.setFont(Fuente.FUENTE_RADIOBUTTON);
        noTomaSintrom.setForeground(Fuente.COLOR_NORMAL);
        noTomaSintrom.setText("no");
        noTomaSintrom.setPreferredSize(new java.awt.Dimension(42, 14));
        noTomaSintrom.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                noTomaSintromActionPerformed(evt);
            }
        });

        textoCrisisConvulsiva.setFont(Fuente.FUENTE_LABEL);
        textoCrisisConvulsiva.setForeground(Fuente.COLOR_NORMAL);
        textoCrisisConvulsiva.setText("Crisis convulsiva");
        textoCrisisConvulsiva.setPreferredSize(new java.awt.Dimension(179, 20));

        siCrisisConvulsiva.setFont(Fuente.FUENTE_RADIOBUTTON);
        siCrisisConvulsiva.setForeground(Fuente.COLOR_NORMAL);
        siCrisisConvulsiva.setText("si");
        siCrisisConvulsiva.setPreferredSize(new java.awt.Dimension(42, 14));
        siCrisisConvulsiva.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                siCrisisConvulsivaActionPerformed(evt);
            }
        });

        noCrisisConvulsiva.setFont(Fuente.FUENTE_RADIOBUTTON);
        noCrisisConvulsiva.setForeground(Fuente.COLOR_NORMAL);
        noCrisisConvulsiva.setText("no");
        noCrisisConvulsiva.setPreferredSize(new java.awt.Dimension(42, 14));
        noCrisisConvulsiva.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                noCrisisConvulsivaActionPerformed(evt);
            }
        });

        textoTEC.setFont(Fuente.FUENTE_LABEL);
        textoTEC.setForeground(Fuente.COLOR_NORMAL);
        textoTEC.setText("TEC");
        textoTEC.setPreferredSize(new java.awt.Dimension(179, 20));

        siTEC.setFont(Fuente.FUENTE_RADIOBUTTON);
        siTEC.setForeground(Fuente.COLOR_NORMAL);
        siTEC.setText("si");
        siTEC.setPreferredSize(new java.awt.Dimension(42, 14));
        siTEC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                siTECActionPerformed(evt);
            }
        });

        noTEC.setFont(Fuente.FUENTE_RADIOBUTTON);
        noTEC.setForeground(Fuente.COLOR_NORMAL);
        noTEC.setText("no");
        noTEC.setPreferredSize(new java.awt.Dimension(42, 14));
        noTEC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                noTECActionPerformed(evt);
            }
        });

        textoCianosis.setFont(Fuente.FUENTE_LABEL);
        textoCianosis.setForeground(Fuente.COLOR_NORMAL);
        textoCianosis.setText("Cianosis");
        textoCianosis.setPreferredSize(new java.awt.Dimension(179, 20));

        siCianosis.setFont(Fuente.FUENTE_RADIOBUTTON);
        siCianosis.setForeground(Fuente.COLOR_NORMAL);
        siCianosis.setText("si");
        siCianosis.setPreferredSize(new java.awt.Dimension(42, 14));
        siCianosis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                siCianosisActionPerformed(evt);
            }
        });

        noCianosis.setFont(Fuente.FUENTE_RADIOBUTTON);
        noCianosis.setForeground(Fuente.COLOR_NORMAL);
        noCianosis.setText("no");
        noCianosis.setPreferredSize(new java.awt.Dimension(42, 14));
        noCianosis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                noCianosisActionPerformed(evt);
            }
        });

        textoRellenoCapilar.setFont(Fuente.FUENTE_LABEL);
        textoRellenoCapilar.setForeground(Fuente.COLOR_NORMAL);
        textoRellenoCapilar.setText("Relleno capilar");
        textoRellenoCapilar.setPreferredSize(new java.awt.Dimension(179, 20));

        siRellenoCapilar.setFont(Fuente.FUENTE_RADIOBUTTON);
        siRellenoCapilar.setForeground(Fuente.COLOR_NORMAL);
        siRellenoCapilar.setText("si");
        siRellenoCapilar.setPreferredSize(new java.awt.Dimension(42, 14));
        siRellenoCapilar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                siRellenoCapilarActionPerformed(evt);
            }
        });

        noRellenoCapilar.setFont(Fuente.FUENTE_RADIOBUTTON);
        noRellenoCapilar.setForeground(Fuente.COLOR_NORMAL);
        noRellenoCapilar.setText("no");
        noRellenoCapilar.setPreferredSize(new java.awt.Dimension(42, 14));
        noRellenoCapilar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                noRellenoCapilarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout panelPreguntasLayout = new javax.swing.GroupLayout(panelPreguntas);
        panelPreguntas.setLayout(panelPreguntasLayout);
        panelPreguntasLayout.setHorizontalGroup(
            panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelPreguntasLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelPreguntasLayout.createSequentialGroup()
                        .addComponent(textoExcitado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(siExcitado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                        .addComponent(noExcitado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelPreguntasLayout.createSequentialGroup()
                        .addComponent(textoSangradoActivo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(siSangradoActivo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                        .addComponent(noSangradoActivo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelPreguntasLayout.createSequentialGroup()
                        .addComponent(textoTomaSintrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(siTomaSintrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                        .addComponent(noTomaSintrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelPreguntasLayout.createSequentialGroup()
                        .addComponent(textoCrisisConvulsiva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(siCrisisConvulsiva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                        .addComponent(noCrisisConvulsiva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelPreguntasLayout.createSequentialGroup()
                        .addComponent(textoTEC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(siTEC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                        .addComponent(noTEC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelPreguntasLayout.createSequentialGroup()
                        .addComponent(textoCianosis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(siCianosis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                        .addComponent(noCianosis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelPreguntasLayout.createSequentialGroup()
                        .addComponent(textoRellenoCapilar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(siRellenoCapilar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                        .addComponent(noRellenoCapilar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelPreguntasLayout.createSequentialGroup()
                        .addComponent(textoInconciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(siInconciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
                        .addComponent(noInconciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelPreguntasLayout.createSequentialGroup()
                        .addComponent(textoTiempoDolorToracico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(tiempoDolorToracico, javax.swing.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE)))
                .addContainerGap())
        );
        panelPreguntasLayout.setVerticalGroup(
            panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelPreguntasLayout.createSequentialGroup()
                .addGroup(panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoTiempoDolorToracico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tiempoDolorToracico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoInconciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(siInconciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(noInconciente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoExcitado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(siExcitado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(noExcitado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addGroup(panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoSangradoActivo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(siSangradoActivo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(noSangradoActivo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoTomaSintrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(siTomaSintrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(noTomaSintrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoCrisisConvulsiva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(siCrisisConvulsiva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(noCrisisConvulsiva, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoTEC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(siTEC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(noTEC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoCianosis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(siCianosis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(noCianosis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelPreguntasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textoRellenoCapilar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(siRellenoCapilar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(noRellenoCapilar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout panelTriageLayout = new javax.swing.GroupLayout(panelTriage);
        panelTriage.setLayout(panelTriageLayout);
        panelTriageLayout.setHorizontalGroup(
            panelTriageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelTriageLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelTriageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(separador1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(panelPreguntas, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 303, Short.MAX_VALUE)
                    .addComponent(panelSignosVitales, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(13, Short.MAX_VALUE))
        );
        panelTriageLayout.setVerticalGroup(
            panelTriageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelTriageLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(panelSignosVitales, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(separador1, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelPreguntas, javax.swing.GroupLayout.PREFERRED_SIZE, 311, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        panelTriageScrollPanel.setViewportView(panelTriage);

        javax.swing.GroupLayout panelDiagnosticoLayout = new javax.swing.GroupLayout(panelDiagnostico);
        panelDiagnostico.setLayout(panelDiagnosticoLayout);
        panelDiagnosticoLayout.setHorizontalGroup(
            panelDiagnosticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelDiagnosticoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelDiagnosticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(textoDiagnostico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(panelDiagnosticoLayout.createSequentialGroup()
                        .addGroup(panelDiagnosticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(textoInformacionComplementariaDiagnostico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(informacionComplementariaDiagnosticoScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 629, Short.MAX_VALUE)
                            .addComponent(diagnosticoScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 629, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(panelTriageScrollPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 345, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelDiagnosticoLayout.createSequentialGroup()
                        .addComponent(textoHoraYFechaEnfermedadYDiagnostico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(horaEnfermedadYDiagnostico, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(fechaEnfermedadYDiagnostico, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        panelDiagnosticoLayout.setVerticalGroup(
            panelDiagnosticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelDiagnosticoLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelDiagnosticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(panelDiagnosticoLayout.createSequentialGroup()
                        .addGap(59, 59, 59)
                        .addComponent(panelTriageScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 557, Short.MAX_VALUE))
                    .addGroup(panelDiagnosticoLayout.createSequentialGroup()
                        .addGroup(panelDiagnosticoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(textoHoraYFechaEnfermedadYDiagnostico, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(horaEnfermedadYDiagnostico)
                            .addComponent(fechaEnfermedadYDiagnostico, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(textoDiagnostico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(8, 8, 8)
                        .addComponent(diagnosticoScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 257, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(textoInformacionComplementariaDiagnostico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(informacionComplementariaDiagnosticoScrollPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)))
                .addContainerGap())
        );

        JSpinner.DateEditor horaDeEnfermedad = new JSpinner.DateEditor(horaEnfermedadYDiagnostico, "HH:mm:ss");
        horaEnfermedadYDiagnostico.setEditor(horaDeEnfermedad);

        botonCancelar.setFont(Fuente.FUENTE_BOTON_EXTERNO);
        botonCancelar.setForeground(Fuente.COLOR_NORMAL);
        botonCancelar.setIcon(Icono.ICONO_16_CANCELAR);
        botonCancelar.setText("Cancelar");
        botonCancelar.setToolTipText("Cancela la operación");
        botonCancelar.setPreferredSize(new java.awt.Dimension(110, 23));
        botonCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonCancelarActionPerformed(evt);
            }
        });

        botonAceptar.setFont(Fuente.FUENTE_BOTON_EXTERNO);
        botonAceptar.setForeground(Fuente.COLOR_NORMAL);
        botonAceptar.setIcon(Icono.ICONO_16_ACEPTAR);
        botonAceptar.setText("Aceptar");
        botonAceptar.setToolTipText("Agrega la  información de la internación");
        botonAceptar.setPreferredSize(new java.awt.Dimension(110, 23));
        botonAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonAceptarActionPerformed(evt);
            }
        });

        textoEstadoEntidad.setFont(Fuente.FUENTE_TEXTFIELD);
        textoEstadoEntidad.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        textoEstadoEntidad.setPreferredSize(new java.awt.Dimension(150, 20));

        botonEpicrisis.setFont(Fuente.FUENTE_BOTON_EXTERNO);
        botonEpicrisis.setForeground(Fuente.COLOR_NORMAL);
        botonEpicrisis.setText("Epicrisis");
        botonEpicrisis.setToolTipText("Abre la ventana de la epicrisis correspondiente a la internación");
        botonEpicrisis.setPreferredSize(new java.awt.Dimension(175, 23));
        botonEpicrisis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonEpicrisisActionPerformed(evt);
            }
        });

        botonAgregarEvolucionEnfermeria.setFont(Fuente.FUENTE_BOTON_EXTERNO);
        botonAgregarEvolucionEnfermeria.setForeground(Fuente.COLOR_NORMAL);
        botonAgregarEvolucionEnfermeria.setIcon(Icono.ICONO_16_AGREGAR);
        botonAgregarEvolucionEnfermeria.setText("Agregar enfermería");
        botonAgregarEvolucionEnfermeria.setToolTipText("Aagrega evoluciones de enfermería");
        botonAgregarEvolucionEnfermeria.setPreferredSize(new java.awt.Dimension(175, 23));
        botonAgregarEvolucionEnfermeria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botonAgregarEvolucionEnfermeriaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(panelDiagnostico, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(textoDescriptivoVentana, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 242, Short.MAX_VALUE)
                        .addComponent(textoEstadoEntidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(botonEpicrisis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(botonAgregarEvolucionEnfermeria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 422, Short.MAX_VALUE)
                        .addComponent(botonAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(botonCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(textoDescriptivoVentana, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textoEstadoEntidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panelDiagnostico, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(11, 11, 11)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botonCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(botonAceptar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(botonEpicrisis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(botonAgregarEvolucionEnfermeria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void botonCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonCancelarActionPerformed
        this.dispose();
    }//GEN-LAST:event_botonCancelarActionPerformed
//GEN-FIRST:event_botonEnfermedadPersonalActionPerformed
//GEN-LAST:event_botonEnfermedadPersonalActionPerformed

    private void botonAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAceptarActionPerformed
        agregarOModificarDiagnosticoYTriageInternacion();
    }//GEN-LAST:event_botonAceptarActionPerformed

    private void siInconcienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_siInconcienteActionPerformed
        if (siInconciente.isSelected()) {
            noInconciente.setSelected(false);
        }
}//GEN-LAST:event_siInconcienteActionPerformed

    private void noInconcienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noInconcienteActionPerformed
        if (noInconciente.isSelected()) {
            siInconciente.setSelected(false);
        }
}//GEN-LAST:event_noInconcienteActionPerformed

    private void siExcitadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_siExcitadoActionPerformed
        if (siExcitado.isSelected()) {
            noExcitado.setSelected(false);
        }
    }//GEN-LAST:event_siExcitadoActionPerformed

    private void noExcitadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noExcitadoActionPerformed
        if (noExcitado.isSelected()) {
            siExcitado.setSelected(false);
        }
    }//GEN-LAST:event_noExcitadoActionPerformed

    private void siSangradoActivoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_siSangradoActivoActionPerformed
        if (siSangradoActivo.isSelected()) {
            noSangradoActivo.setSelected(false);
        }
    }//GEN-LAST:event_siSangradoActivoActionPerformed

    private void noSangradoActivoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noSangradoActivoActionPerformed
        if (noSangradoActivo.isSelected()) {
            siSangradoActivo.setSelected(false);
        }
    }//GEN-LAST:event_noSangradoActivoActionPerformed

    private void siTomaSintromActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_siTomaSintromActionPerformed
        if (siTomaSintrom.isSelected()) {
            noTomaSintrom.setSelected(false);
        }
    }//GEN-LAST:event_siTomaSintromActionPerformed

    private void noTomaSintromActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noTomaSintromActionPerformed
        if (noTomaSintrom.isSelected()) {
            siTomaSintrom.setSelected(false);
        }
    }//GEN-LAST:event_noTomaSintromActionPerformed

    private void siCrisisConvulsivaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_siCrisisConvulsivaActionPerformed
        if (siCrisisConvulsiva.isSelected()) {
            noCrisisConvulsiva.setSelected(false);
        }
    }//GEN-LAST:event_siCrisisConvulsivaActionPerformed

    private void noCrisisConvulsivaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noCrisisConvulsivaActionPerformed
        if (noCrisisConvulsiva.isSelected()) {
            siCrisisConvulsiva.setSelected(false);
        }
    }//GEN-LAST:event_noCrisisConvulsivaActionPerformed

    private void siTECActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_siTECActionPerformed
        if (siTEC.isSelected()) {
            noTEC.setSelected(false);
        }
    }//GEN-LAST:event_siTECActionPerformed

    private void noTECActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noTECActionPerformed
        if (noTEC.isSelected()) {
            siTEC.setSelected(false);
        }
    }//GEN-LAST:event_noTECActionPerformed

    private void siCianosisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_siCianosisActionPerformed
        if (siCianosis.isSelected()) {
            noCianosis.setSelected(false);
        }
    }//GEN-LAST:event_siCianosisActionPerformed

    private void noCianosisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noCianosisActionPerformed
        if (noCianosis.isSelected()) {
            siCianosis.setSelected(false);
        }
    }//GEN-LAST:event_noCianosisActionPerformed

    private void siRellenoCapilarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_siRellenoCapilarActionPerformed
        if (siRellenoCapilar.isSelected()) {
            noRellenoCapilar.setSelected(false);
        }
    }//GEN-LAST:event_siRellenoCapilarActionPerformed

    private void noRellenoCapilarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noRellenoCapilarActionPerformed
        if (noRellenoCapilar.isSelected()) {
            siRellenoCapilar.setSelected(false);
        }
    }//GEN-LAST:event_noRellenoCapilarActionPerformed

    private void botonEpicrisisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonEpicrisisActionPerformed
        if (diagnosticoYTriageInternacion != null) {
            RestriccionAcceso.EpicrisisInternacionPresentacion(null, true,
                    diagnosticoYTriageInternacion);
        }
}//GEN-LAST:event_botonEpicrisisActionPerformed

    private void botonAgregarEvolucionEnfermeriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botonAgregarEvolucionEnfermeriaActionPerformed
        agregarEvolucionEnfermeriaDeInternacion();
    }//GEN-LAST:event_botonAgregarEvolucionEnfermeriaActionPerformed

    /**
     * Agrega una evolución enfermeria de internacion a la internación seleccionada.
     *
     */
    public void agregarEvolucionEnfermeriaDeInternacion() {
        if (diagnosticoYTriageInternacion != null) {
            RestriccionAcceso.EvolucionEnfermeriaDeInternacion(null, true,
                    diagnosticoYTriageInternacion, null);
        }
    }

    /**
     * Agrega/modifica el diagnóstico y triage del paciente
     *
     * @return true si se agregó/modificó correctamente, false en caso contrario
     */
    private void agregarOModificarDiagnosticoYTriageInternacion() {
        //Valida todos los datos ingresados
        if (validarCampos()) {
            if (CapaPresentacion.confirmarModificacion("diagnóstico", "el")) {
                //Carga toda la información de la pantalla
                recopilarInformacionDiagnosticoYTriageInternacion();
                int[] idDiagnosticoYTriageInternacion = new int[1];
                if (CapaPresentacion.modoModificacion) {
                    //Modificación de diagnosticoYTriageInternacion
                    idDiagnosticoYTriageInternacion[0] =
                            diagnosticoYTriageInternacion.
                            getIdDiagnosticoYTriageInternacion();
                } else {
                    //Alta de diagnosticoYTriageInternacion
                    idDiagnosticoYTriageInternacion[0] = -1;
                }

                if (DiagnosticoYTriageInternacionLogica.
                        agregarDiagnosticoYTriageInternacion(
                        datosDiagnosticoInternacion,
                        GestionPacientePresentacion.getPaciente(),
                        diagnosticoYTriageInternacion,
                        idDiagnosticoYTriageInternacion)) {
                    diagnosticoYTriageInternacion = DiagnosticoYTriageInternacionLogica.
                            getDiagnosticoYTriageInternacionPorId(
                            idDiagnosticoYTriageInternacion[0]);
                    //TRIAGE
                    if (agregarOModificarTriage()) {
                        dispose();
                    }
                }
            }
        } else {
            MensajePresentacion.errorDatosInvalidos();
        }
    }

    /**
     * Valida en conjunto todos los campos. Aquellos que son obligatorios y los
     * que no.
     *
     * @return true si el objeto está listo para cargarse, false en caso
     * contrario
     */
    private boolean validarCampos() {
        boolean esHoraYFechaValida = validarHoraYFecha();
        boolean esDiagnosticoValida = validarDiagnostico();

        return (esHoraYFechaValida && esDiagnosticoValida);
    }

    /**
     * Valida los campos correspondiente a la fecha y hora
     *
     * @return true si los campos estan listos para cargarse, false en caso
     * contrario
     */
    private boolean validarHoraYFecha() {
        //Manejo de la validación de fecha
        if (!CapaValidacion.validarFecha(
                fechaEnfermedadYDiagnostico.getDate(), "", true)) {
            textoHoraYFechaEnfermedadYDiagnostico.setForeground(
                    Fuente.COLOR_ERROR);
            textoHoraYFechaEnfermedadYDiagnostico.setToolTipText(InformeError.
                    INFORME_ERROR_USO_COMUN_HORA_Y_FECHA);
            return false;
        } else {
            textoHoraYFechaEnfermedadYDiagnostico.setForeground(
                    Fuente.COLOR_NORMAL);
            textoHoraYFechaEnfermedadYDiagnostico.setToolTipText(null);
            return true;
        }
    }

    /**
     * Valida los campos correspondiente al diagnóstico
     *
     * @return true si los campos estan listos para cargarse, false en caso
     * contrario
     */
    private boolean validarDiagnostico() {
        //Manejo de la validación del diagnóstico
        if (!CapaValidacion.validarCampoObligatorio(
                diagnostico.getText())) {
            textoDiagnostico.setForeground(
                    Fuente.COLOR_ERROR);
            textoDiagnostico.setToolTipText(InformeError.
                    INFORME_ERROR_DIAGNOSTICO_INTERNACION_DIAGNOSTICO);
            return false;
        } else {
            textoDiagnostico.setForeground(
                    Fuente.COLOR_NORMAL);
            textoDiagnostico.setToolTipText(null);
            return true;
        }
    }

    /**
     * Carga todos los datos ingresados en pantalla.
     *
     */
    private void recopilarInformacionDiagnosticoYTriageInternacion() {
        datosDiagnosticoInternacion = new Object[4];

        datosDiagnosticoInternacion[
                CapaLogica.DIAGNOSTICO_Y_TRIAGE_INTERNACION_HORA] =
                CapaLogica.separarTiempo(horaEnfermedadYDiagnostico.
                getValue().toString());

        datosDiagnosticoInternacion[
                CapaLogica.DIAGNOSTICO_Y_TRIAGE_INTERNACION_FECHA] =
                fechaEnfermedadYDiagnostico.getDate();

        datosDiagnosticoInternacion[CapaLogica.
                DIAGNOSTICO_Y_TRIAGE_INTERNACION_DIAGNOSTICO] =
                diagnostico.getText();

        datosDiagnosticoInternacion[CapaLogica.
                DIAGNOSTICO_Y_TRIAGE_INTERNACION_DESCRIPCION_DIAGNOSTICO] =
                informacionComplementariaDiagnostico.getText();
    }

    /**
     * Agrega el triage para el diagnóstico del paciente.
     *
     * @return true si se agregó correctamente, false en caso contrario
     */
    private boolean agregarOModificarTriage() {
        //Carga toda la información de la pantalla
        recopilarInformacionTriage();

        //Si se debe crear
        if (TriageLogica.seDebeCrearTriage(datosTriageInternacion)) {
            if (TriageLogica.agregarTriage(
                    datosTriageInternacion, diagnosticoYTriageInternacion)) {
                return true;
            } else {
                return false;
            }
        }

        return true;
    }

    /**
     * Carga todos los datos ingresados en pantalla.
     *
     */
    private void recopilarInformacionTriage() {
        datosTriageInternacion = new Object[25];

        ((DatosSignosVitales) panelSignosVitales.getComponent(0)).
                recopilarInformacionSignosVitales(datosTriageInternacion);

        datosTriageInternacion[
                CapaLogica.TRIAGE_TIEMPO_DOLOR_TORACICO] =
                tiempoDolorToracico.getValue();

        if (siInconciente.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_INCONCIENTE] =
                "si";
        } else if (noInconciente.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_INCONCIENTE] =
                "no";
        } else {
            datosTriageInternacion[
                CapaLogica.TRIAGE_INCONCIENTE] =
                "";
        }

        if (siExcitado.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_EXCITADO] =
                "si";
        } else if (noExcitado.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_EXCITADO] =
                "no";
        } else {
            datosTriageInternacion[
                CapaLogica.TRIAGE_EXCITADO] =
                "";
        }

        if (siSangradoActivo.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_SANGRADO_ACTIVO] =
                "si";
        } else if (noSangradoActivo.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_SANGRADO_ACTIVO] =
                "no";
        } else {
            datosTriageInternacion[
                CapaLogica.TRIAGE_SANGRADO_ACTIVO] =
                "";
        }

        if (siTomaSintrom.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_TOMA_SINTROM] =
                "si";
        } else if (noTomaSintrom.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_TOMA_SINTROM] =
                "no";
        } else {
            datosTriageInternacion[
                CapaLogica.TRIAGE_TOMA_SINTROM] =
                "";
        }

        if (siCrisisConvulsiva.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_CRISIS_CONVULSIVA] =
                "si";
        } else if (noCrisisConvulsiva.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_CRISIS_CONVULSIVA] =
                "no";
        } else {
            datosTriageInternacion[
                CapaLogica.TRIAGE_CRISIS_CONVULSIVA] =
                "";
        }

        if (siTEC.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_TEC] =
                "si";
        } else if (noTEC.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_TEC] =
                "no";
        } else {
            datosTriageInternacion[
                CapaLogica.TRIAGE_TEC] =
                "";
        }

        if (siCianosis.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_CIANOSIS] =
                "si";
        } else if (noCianosis.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_CIANOSIS] =
                "no";
        } else {
            datosTriageInternacion[
                CapaLogica.TRIAGE_CIANOSIS] =
                "";
        }

        if (siRellenoCapilar.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_RELLENO_CAPILAR] =
                "si";
        } else if (noRellenoCapilar.isSelected()) {
            datosTriageInternacion[
                CapaLogica.TRIAGE_RELLENO_CAPILAR] =
                "no";
        } else {
            datosTriageInternacion[
                CapaLogica.TRIAGE_RELLENO_CAPILAR] =
                "";
        }
    }

    /**
     * Setea en cada componente del JDialog los eventos que capturarán la tecla
     * enter y escape.
     */
    private void setearEventosQueCapturanTeclaEnterYEscape() {
        //Declaración del evento a capturar
        KeyListener keyListenerEnter = new KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                if (evt.getKeyCode() == KeyEvent.VK_ENTER) {
                    //Llamada al método que capturará el boton enter y
                    //trabajará sobre el mismo
                    agregarOModificarDiagnosticoYTriageInternacion();
                }
            }
        };
        //Declaración del evento a capturar
        KeyListener keyListenerEscape = new KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) {
                    //Llamada al método que capturará el boton enter y
                    //trabajará sobre el mismo
                    dispose();
                }
            }
        };
        //Setear eventosr
        ((DefaultEditor) horaEnfermedadYDiagnostico.getEditor()).
                getTextField().addKeyListener(keyListenerEnter);
        ((DefaultEditor) horaEnfermedadYDiagnostico.getEditor()).
                getTextField().addKeyListener(keyListenerEscape);

        ((IDateEditor) fechaEnfermedadYDiagnostico.getDateEditor()).
                getUiComponent().addKeyListener(keyListenerEnter);
        ((IDateEditor) fechaEnfermedadYDiagnostico.getDateEditor()).
                getUiComponent().addKeyListener(keyListenerEscape);

        
        diagnostico.addKeyListener(keyListenerEscape);
        informacionComplementariaDiagnostico.addKeyListener(keyListenerEscape);

        ((DatosSignosVitales) panelSignosVitales.getComponent(0)).
                setearEventosQueCapturanTeclaEnterYEscape(
                keyListenerEnter, keyListenerEscape);

        ((DefaultEditor) tiempoDolorToracico.getEditor()).
                getTextField().addKeyListener(keyListenerEnter);
        ((DefaultEditor) tiempoDolorToracico.getEditor()).
                getTextField().addKeyListener(keyListenerEscape);

        siInconciente.addKeyListener(keyListenerEnter);
        siInconciente.addKeyListener(keyListenerEscape);
        noInconciente.addKeyListener(keyListenerEnter);
        noInconciente.addKeyListener(keyListenerEscape);

        siExcitado.addKeyListener(keyListenerEnter);
        siExcitado.addKeyListener(keyListenerEscape);
        noExcitado.addKeyListener(keyListenerEnter);
        noExcitado.addKeyListener(keyListenerEscape);

        siSangradoActivo.addKeyListener(keyListenerEnter);
        siSangradoActivo.addKeyListener(keyListenerEscape);
        noSangradoActivo.addKeyListener(keyListenerEnter);
        noSangradoActivo.addKeyListener(keyListenerEscape);

        siTomaSintrom.addKeyListener(keyListenerEnter);
        siTomaSintrom.addKeyListener(keyListenerEscape);
        noTomaSintrom.addKeyListener(keyListenerEnter);
        noTomaSintrom.addKeyListener(keyListenerEscape);

        siCrisisConvulsiva.addKeyListener(keyListenerEnter);
        siCrisisConvulsiva.addKeyListener(keyListenerEscape);
        noCrisisConvulsiva.addKeyListener(keyListenerEnter);
        noCrisisConvulsiva.addKeyListener(keyListenerEscape);

        siTEC.addKeyListener(keyListenerEnter);
        siTEC.addKeyListener(keyListenerEscape);
        noTEC.addKeyListener(keyListenerEnter);
        noTEC.addKeyListener(keyListenerEscape);

        siCianosis.addKeyListener(keyListenerEnter);
        siCianosis.addKeyListener(keyListenerEscape);
        noCianosis.addKeyListener(keyListenerEnter);
        noCianosis.addKeyListener(keyListenerEscape);

        siRellenoCapilar.addKeyListener(keyListenerEnter);
        siRellenoCapilar.addKeyListener(keyListenerEscape);
        noRellenoCapilar.addKeyListener(keyListenerEnter);
        noRellenoCapilar.addKeyListener(keyListenerEscape);

        botonAceptar.addKeyListener(keyListenerEscape);
        botonCancelar.addKeyListener(keyListenerEscape);
    }

    /**
     * Retorna la internación agregada.
     *
     * @return El objeto DiagnosticoYTriageInternacion agregado
     */
    public static DiagnosticoYTriageInternacion getDiagnosticoYTriageInternacion() {
        return diagnosticoYTriageInternacion;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botonAceptar;
    private javax.swing.JButton botonAgregarEvolucionEnfermeria;
    private javax.swing.JButton botonCancelar;
    private javax.swing.JButton botonEpicrisis;
    private javax.swing.JTextArea diagnostico;
    private javax.swing.JScrollPane diagnosticoScrollPanel;
    private com.toedter.calendar.JDateChooser fechaEnfermedadYDiagnostico;
    private javax.swing.JSpinner horaEnfermedadYDiagnostico;
    private javax.swing.JTextArea informacionComplementariaDiagnostico;
    private javax.swing.JScrollPane informacionComplementariaDiagnosticoScrollPanel;
    private javax.swing.JRadioButton noCianosis;
    private javax.swing.JRadioButton noCrisisConvulsiva;
    private javax.swing.JRadioButton noExcitado;
    private javax.swing.JRadioButton noInconciente;
    private javax.swing.JRadioButton noRellenoCapilar;
    private javax.swing.JRadioButton noSangradoActivo;
    private javax.swing.JRadioButton noTEC;
    private javax.swing.JRadioButton noTomaSintrom;
    private javax.swing.JPanel panelDiagnostico;
    private javax.swing.JPanel panelPreguntas;
    private javax.swing.JPanel panelSignosVitales;
    private javax.swing.JPanel panelTriage;
    private javax.swing.JScrollPane panelTriageScrollPanel;
    private javax.swing.JSeparator separador1;
    private javax.swing.JRadioButton siCianosis;
    private javax.swing.JRadioButton siCrisisConvulsiva;
    private javax.swing.JRadioButton siExcitado;
    private javax.swing.JRadioButton siInconciente;
    private javax.swing.JRadioButton siRellenoCapilar;
    private javax.swing.JRadioButton siSangradoActivo;
    private javax.swing.JRadioButton siTEC;
    private javax.swing.JRadioButton siTomaSintrom;
    private javax.swing.JLabel textoCianosis;
    private javax.swing.JLabel textoCrisisConvulsiva;
    private javax.swing.JLabel textoDescriptivoVentana;
    private javax.swing.JLabel textoDiagnostico;
    private javax.swing.JLabel textoEstadoEntidad;
    private javax.swing.JLabel textoExcitado;
    private javax.swing.JLabel textoHoraYFechaEnfermedadYDiagnostico;
    private javax.swing.JLabel textoInconciente;
    private javax.swing.JLabel textoInformacionComplementariaDiagnostico;
    private javax.swing.JLabel textoRellenoCapilar;
    private javax.swing.JLabel textoSangradoActivo;
    private javax.swing.JLabel textoTEC;
    private javax.swing.JLabel textoTiempoDolorToracico;
    private javax.swing.JLabel textoTomaSintrom;
    private javax.swing.JSpinner tiempoDolorToracico;
    // End of variables declaration//GEN-END:variables
    private static DiagnosticoYTriageInternacion diagnosticoYTriageInternacion;
    private Object[] datosDiagnosticoInternacion;
    private Object[] datosTriageInternacion;
}
